﻿<%@ Page Language="C#" %>
<%@ Import Namespace="System.Linq" %>
<%--可以通过提示框打开此消息页面，指定显示传递过来的消息
如：ModulePlugin/SysMessage/PageUI/LookMessage.aspx?MessageId=2--%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>消息管理界面</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <link rel="stylesheet" type="text/css" href="../../../WebPlugin/jquery-easyui/themes/default/easyui.css"/>
	<link rel="stylesheet" type="text/css" href="../../../WebPlugin/jquery-easyui/themes/icon.css"/>
	<script type="text/javascript" src="../../../WebPlugin/jquery-easyui/jquery-1.7.1.min.js"></script>
	<script type="text/javascript" src="../../../WebPlugin/jquery-easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="../../../WebPlugin/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>

    <script src="../../../WebPlugin/jquery-easyui/JQueryCommon.js" type="text/javascript"></script>
    <script src="../PageJS/LookMessage.js" type="text/javascript"></script>
    
    <script language="javascript">
     var MessageId=<%=Request.Params.AllKeys.Contains("MessageId") == true ? Request["MessageId"] : "''"%>
    </script>
</head>
<body class="easyui-layout">
 <div region="west" split="true" id="layout_west" style="width:200px;" closable="false" title="消息箱"> 
    <ul id="treeload" class="easyui-tree" animate="true" dnd="true">
        <li><a onclick="tree_getmessage(1);">已收消息</a></li>
		<li><a onclick="tree_getmessage(0);">未读消息</a></li>
		<li><a onclick="tree_getmessage(2);">已发消息</a></li>
    </ul>
 </div>
 <div region="center" title="消息列表">
    <div class="easyui-layout" fit="true" border="false">
    <div region="west" style="width:420px;">
    <div id="tool" class="toolbar">
        <a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-search" onclick="btn_searchMessage();">查询</a>
        <a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-reload" onclick="btn_reloadMessage();">刷新</a>
        <a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-add" onclick="btn_addMessage();">新建公告</a>
        <a href="#" class="easyui-linkbutton" style="display:none;" plain="true" iconCls="icon-edit" onclick="btn_answerMessage();">答复</a>
    </div>
    <table id="messageGrid" idField="Id" class="easyui-datagrid" fit="true" toolbar="#tool" border="false" rownumbers= "true" singleSelect="true" pagination= "true">
        <thead>
            <tr>
                <th field="TypeCode" width="100" formatter="textFormatter">消息类型</th>
                <th field="TitleText" width="200">主题</th>
                <th field="SendTime" width="150">发送时间</th>
            </tr>
        </thead>
    </table>
    </div>
    <div region="center" style="padding:5px" >
        <div id="messageContextDiv"></div>
    </div>
    </div>
 </div>
</body>

<div id="dlg-searchMessage" class="easyui-dialog" title="查询消息" style="width:400;height:200px;padding:5px" buttons="#dlg-buttons2" resizable="true" modal="true">
        <table style="padding:10px;">
            <tr>
                <td>选择查询范围:</td>
                <td><input id="searchrange" class="easyui-combobox"  style="width:200px;" type="text" required="true" valueField="code" textField="name" ></input></td>
           </tr>
           <tr>
                <td>选择消息类型:</td>
                <td><input id="searchmessagetype" class="easyui-combobox"  style="width:200px;" type="text" required="true" valueField="CODE" textField="NAME" url="Controller.aspx?controller=MessageController&method=GetMessageTypeData"></input></td>
           </tr>
           <tr style="display:none;">
                <td>发送人:</td>
                <td><input id="searchsenduser" class="easyui-validatebox"  style="width:200px;" type="text" ></input></td>
           </tr>
           <tr style="display:none;">
                <td>主题:</td>
                <td><input id="searchtitle" class="easyui-validatebox"  style="width:200px;" type="text" ></input></td>
           </tr>
        </table>  
</div>
<div id="dlg-buttons2">
    <a href="#" class="easyui-linkbutton" onclick="dlg_searchMessageOk();">确定</a>
    <a href="#" class="easyui-linkbutton" onclick="$('#dlg-searchMessage').dialog('close');">取消</a>
</div>

<div id="dlg-addMessage" class="easyui-dialog" title="新增消息" style="width:450;height:350px;padding:5px" buttons="#dlg-buttons" resizable="true" modal="true">
  <form id="formaddmessage" method="post">
        <table style="padding:10px;">
           <tr>
                <td>消息类型:</td>
                <td><input id="formmessagetypecode" class="easyui-combobox"  style="width:200px;" type="text" required="true" valueField="CODE" textField="NAME" name="TypeCode1" url="Controller.aspx?controller=MessageController&method=GetUserMessageTypeData"></input></td>
           </tr>
           <tr style="display:none;">
                <td>选择机构:</td>
                <td><input id="formReceiveWorkId" class="easyui-combobox"  style="width:200px;" type="text"  valueField="code" textField="name" name="ReceiveWorkId" url="Controller.aspx?controller=MessageController&method=GetWorkerData"></input></td>
           </tr>
           <tr style="display:none;">
                <td>选择科室:</td>
                <td><input id="formReceiveDeptId" class="easyui-combobox"  style="width:200px;" type="text"  valueField="code" textField="name" name="ReceiveDeptId" url="Controller.aspx?controller=MessageController&method=GetDeptData"></input></td>
           </tr>
           <tr style="display:none;">
                <td>选择人员:</td>
                <td><input id="formReceiveUserId" class="easyui-combobox"  style="width:200px;" type="text"  valueField="USER_ID" textField="NAME" name="ReceiveUserId" url="Controller.aspx?controller=MessageController&method=GetUserData"></input></td>
           </tr>
           <tr>
                <td>消息标题:</td>
                <td><input id="formTitleText" class="easyui-validatebox"  style="width:200px;" type="text" required="true" name="TitleText"></input></td>
           </tr>
           <tr>
                <td>消息内容:</td>
                <td><textarea id="formContentText" style="width:250px; height:100px" name="ContentText"></textarea></td>
           </tr>
        </table>  
        <input id="formmessageId" type="hidden" name="Id">
        <input id="formmessagetypecode1" type="hidden" name="TypeCode" value="06">
        <input id="formSendUserId" type="hidden" name="SendUserId">
        <input id="fromSendDeptId" type="hidden" name="SendDeptId">
        <input id="fromSendWorkId" type="hidden" name="SendWorkId">
        <input id="fromAnswer_MessageId" type="hidden" name="Answer_MessageId">
   </form>
</div>
<div id="dlg-buttons">
    <a href="#" class="easyui-linkbutton" onclick="dlg_addMessageOk();">确定</a>
    <a href="#" class="easyui-linkbutton" onclick="$('#dlg-addMessage').dialog('close');">取消</a>
</div>

<div id="dlg-AnswerMessage" class="easyui-dialog" title="回复消息" style="width:450;height:250px;padding:5px" buttons="#dlg-buttons3" resizable="true" modal="true">
  <form id="formanswermessage" method="post">
        <table style="padding:10px;">
           <tr>
                <td>消息标题:</td>
                <td><input id="formanswermessageTitleText" class="easyui-validatebox"  style="width:200px;" type="text" required="true" name="TitleText"></input></td>
           </tr>
           <tr>
                <td>消息内容:</td>
                <td><textarea id="formanswermessageContentText" style="width:250px; height:100px" name="ContentText"></textarea></td>
           </tr>
        </table>  
        <input id="formanswermessageTypeCode" type="hidden" name="TypeCode">
        <input id="formanswermessageReceiveWorkId" type="hidden" name="ReceiveWorkId">
        <input id="formanswermessageReceiveDeptId" type="hidden" name="ReceiveDeptId">
        <input id="formanswermessageReceiveUserId" type="hidden" name="ReceiveUserId">
        <input id="formAnswerAnswer_MessageId" type="hidden" name="Answer_MessageId">
   </form>
</div>
<div id="dlg-buttons3">
    <a href="#" class="easyui-linkbutton" onclick="dlg_AnswerMessageOk();">确定</a>
    <a href="#" class="easyui-linkbutton" onclick="$('#dlg-AnswerMessage').dialog('close');">取消</a>
</div>
</html>